<?php
namespace app\admin\controller\louguan;
use app\admin\controller\Controller;
use app\admin\model\agent\User as UserModel;
use app\admin\model\agent\Agent as AgentModel;
use think\Db;
use think\Session;
/**
 * 楼管管理
 */

class Louguan extends Controller{
    protected  $model;
    public function _initialize(){
        parent::_initialize();
        $this->model=new AgentModel();
    }

    /**
     * 人员列表
     */
    public function index(){
        $userinfo=Db::name('love_admin_user')->where(['id'=>Session::get('yoshop_admin')['user']['id']])->find();
        $title=input('get.name');
        if($title){
            $where['name|user_name']=["like",'%'.trim($title).'%'];
        }
        //楼管管理员
        $where['areaid']=['=',$userinfo['areaid']];
        $where['type']=['=',6];
        $list=Db::name('love_admin_user')->where($where)->order('create_time desc')->paginate(15, false, [
            'query' => \request()->request()
        ]);
        return $this->fetch('index', [
            'list' =>$list,
        ]);
    }
}